import {ByteRange_Pro} from "@/utils/utils"

export const addSchema: FormSchema = {
    "style": {
        "width": "auto"
    },
    "formItemLayout": {
        "labelCol": {
            "span": 6
        },
        "wrapperCol": {
            "span": 18
        }
    },
    "formItem": [
        {
            key: 'type',
            value: 1,
            hidden: true,
        },
        {
            "type": "input",
            "label": "策略名称",
            "key": "name",
            "value": "",
            "props": {
                "placeholder": "策略名称"
            },
            "rules": [
                {
                    "required": true,
                    "message": "策略名称不能为空"
                }
            ]
        },
        {
            "type": "input",
            "label": "进程名称",
            "key": "processname",
            "value": "",
            "props": {
                "placeholder": "进程名称(带扩展名)"
            },
            "rules": [
                {
                    "required": true,
                    "message": "进程名称不能为空"
                },
                {
                    "validator":(rule,value,callback)=>{return ByteRange_Pro(rule,value,callback,260)},
                    "message": "进程名称最多260个字节"
                }
            ]
        },
        {
            "type": "input",
            "label": "进程描述",
            "key": "processfigerprint",
            "value": "",
            "props": {
                "placeholder": "进程描述"
            }
        },
    ]
}
